package com.uzai.console.mapper;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.md.mdexchange.MdExchangeQuery;
import com.uzai.console.entity.MdExchange;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface MdExchangeMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    MdExchange selectById(@Param("id") Long id, @Param("merId") Long merId);

    int updateStatusById(MdExchange record);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<MdExchange> findByList(Page<MdExchange> page, @Param("query") MdExchangeQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<MdExchange> findByList(@Param("query") MdExchangeQuery query);

    /**
     * 统计免单活动下商品的已下单记录
     * @return
     */
    Integer countPayOrderWithGoodsId(@Param("goodsId") Long goodsId, @Param("activityId") Long activityId, @Param("merId") Long merId);

    ArrayList<MdExchange> selectPayExchanges(@Param("query") MdExchangeQuery mdExchangeQuery);
}